#include <stdio.h>
#include <stdlib.h>

#include "pile.h"
#include "TableauDynamique.h"


void initialiserPile(Pile * P){
	initialiser(P);
}

void testamentPile(Pile * P){
	testament(P);
}

unsigned int getNbItemsDansPile(const Pile * P){
	return (P->capacite);
}

void emPiler(Pile * P, Elem e){
	Pile *new;
	new=(new*)malloc(sizeof(new));
	
	if((P==NULL)||(new==NULL)){
		exit(EXIT_FAILURE);
	}
	
	new->ad=P->ad;
	new->capacite=e;
	new->derniere_position=P->derniere_position;
	
}

void dePiler(Pile * P){
	if(P==NULL)
		exit(EXIT_FAILURE);
	
	Pile *elmDepile=P->derniere_position;
	if((P!=NULL)&&(P->derniere_position !=NULL)){
		P->derniere_position=elmDepile->derniere_position;
		free(elmDepile);
	}
	
}

Elem sommetDeLaPile(const Pile * P){

}

int testPileVide(const Pile * P){
	if(P->ad==NULL)
		return 1;
	else
		return 0;
}
